﻿@using A2.ERP.Models
@model A2.ERP.Models.t_Products

@{
    t_Products model = ViewBag.model;
}


<section id="EditProducts">
    <div class="card">
        <div class="card-header">
            <i class="icon SkyUI icon-edit"></i>
            编辑用户
        </div>
        <div class="card-body">
            <form class="editProductsFrm" action="/setting/EditProducts">
                @Html.TextBoxFor(i => i.ProductsID, new { Value = model.ProductsID, @class = "form-control", style="display:none;" })
                <div class="form-group">
                    <label>商品名称</label>
                    @Html.TextBoxFor(i => i.ProductsName, new { Value = model.ProductsName, @class = "form-control" })
                </div>
                <div class="form-group">
                    <label>规格</label>
                    @Html.TextBoxFor(i => i.ProductsUints, new { Value = model.ProductsUints, @class = "form-control" })
                </div>
                <div>
                    <label>

                    </label>
                </div>
                @*<div class="form-group">
                        <label>权限组管理</label>
                        @Html.DropDownList("GroupID", group.Select(i => new SelectListItem { Value = i.GroupID.ToString(), Text = i.GroupName }), new { @class = "form-control" })
                    </div>*@
                <div class="form-group">
                    <label>重量</label>
                    @Html.TextBoxFor(i => i.Weight, new { Value = model.Weight, @class = "form-control" })
                </div>
                <div class="form-group">
                    <label>规格</label>
                    @Html.TextBoxFor(i => i.Spec, new { Value = model.Spec, @class = "form-control" })
                </div>
                <div class="form-group">
                    <label>库存上限</label>
                    @Html.TextBoxFor(i => i.UpperLimit, new { Value = model.UpperLimit, @class = "form-control" })
                </div>
                <div class="form-group">
                    <label>库存下限</label>
                    @Html.TextBoxFor(i => i.LowerLimit, new { Value = model.LowerLimit, @class = "form-control" })
                </div>
                <div class="form-group">
                    <label>入库时间</label>
                    @Html.TextBoxFor(i => i.BeginEnterDate, new { Value = model.BeginEnterDate, @class = "form-control" })
                </div>
                <div class="form-group">
                    <label>详情</label>
                    @Html.TextBoxFor(i => i.Description, new { Value = model.Description, @class = "form-control" })
                </div>
                <div class="form-group">
                    <label>状态</label>
                    @Html.DropDownList("State", new List<dynamic>() { new { value = "Y", name = "启用" }, new { value = "N", name = "禁用" } }.Select(i => new SelectListItem { Value = i.value, Text = i.name }), new { @class = "form-control" })
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary submit">修改</button>
                </div>
            </form>
        </div>
    </div>
</section>

<script>
    var $editProductsFrm = $('#EditProducts .editProductsFrm');

    $editProductsFrm.submit(function (e) {
        e.preventDefault();

        $editProductsFrm.ajaxSubmit({
            type: 'PUT',
            dataType: 'json',
            success: function (data) {
                $tab.reloadTab('#SysProductsManager');
                $tab.close($('#EditProducts'));
            }
        });
    });
</script>